angular.module('starter.directive', [])
.directive("appMap", function () {
  return {
    restrict: "E",
    replace: true,
    template: "<div id='allMap'></div>",
    scope: {
      center: "=",		// Center point on the map (e.g. <code>{ latitude: 10, longitude: 10 }</code>).
      markers: "=",	   // Array of map markers (e.g. <code>[{ lat: 10, lon: 10, name: "hello" }]</code>).
      width: "@",		 // Map width in pixels.
      height: "@",		// Map height in pixels.
      zoom: "@",		  // Zoom level (one is totally zoomed out, 25 is very much zoomed in).
      zoomControl: "@",   // Whether to show a zoom control on the map.
      scaleControl: "@",   // Whether to show scale control on the map.
      address:"@"
    },
    link: function (scope, element, attrs) {
      var map;
      // 百度地图API功能
      map = new BMap.Map("allMap");
      var point = new BMap.Point(116.404, 39.915);  // 创建点坐标  
	  map.centerAndZoom(point, 15);                 // 初始化地图，设置中心点坐标和地图级别  
    }
  };
});